public class likou589 {
    class Solution {
        public boolean buddyStrings(String s, String goal) {
        if(s.length()!=goal.length())return false;
        if(s.equal(goal))return true;
        int first=0,second=0;
        int count=0;
        for(int i=0;i<s.length();i++){
            for(int j=i;j<s.length();j++){
                if(s.charAt(j)!=goal.charAt(j)){
                    count++;
                }
            }
        }
        if(count==2||count==0)return true;
        else return flase;
    }
}
